'use strict';

module.exports = function collectSameElements(collectionA, objectB) {
  let arr1 = objectB.value;
  let arr2 = new Array();
  for(let i of collectionA){
    arr2.push(i.key);
  }
  return arr2.filter(function(i){
    return arr1.indexOf(i)!==-1;
  });
}
